import 'package:fluro/fluro.dart';
import 'package:fluro/src/router.dart';
import 'package:flutter_shop/cons/global_cons.dart';
import 'package:flutter_shop/pages/home/goods_detail/goods_detail_page.dart';
import 'package:flutter_shop/routers/router_init.dart';

///首页相关路由管理
class HomeRouter implements IRouterProvider {
  ///商品详情
  static const goodDetail = "/home/goodDetail";

  @override
  void initRouter(Router router) {
    //商品详情
    router.define(goodDetail, handler: Handler(handlerFunc: (_, params) {
      String goodsId = params[GlobalCons.KEY_ID].first;
      return GoodsDetailPage(goodsId: goodsId);
    }));
  }
}
